@extends('_layouts.blank')

@section('page-level-styles')
{{ HTML::style('assets/global/plugins/data-tables/DT_bootstrap.css') }}
{{ HTML::style('assets/global/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css') }}
{{ HTML::style('assets/global/plugins/bootstrap-modal/css/bootstrap-modal.css') }}
{{ HTML::style('assets/global/plugins/chosen-bootstrap/chosen/chosen.css') }}
@stop

@section('page-level-plugins')
{{ HTML::script('assets/global/plugins/data-tables/jquery.dataTables.js') }}
{{ HTML::script('assets/global/plugins/data-tables/DT_bootstrap.js') }}
{{ HTML::script('assets/global/plugins/bootstrap-modal/js/bootstrap-modalmanager.js') }}
{{ HTML::script('assets/global/plugins/bootstrap-modal/js/bootstrap-modal.js') }}
{{ HTML::script('assets/global/plugins/jquery-validation/js/jquery.validate.min.js') }}
{{ HTML::script('assets/global/plugins/chosen-bootstrap/chosen/chosen.jquery.min.js') }}
@stop

@section('page-level-script')
{{ HTML::script('assets/global/scripts/datatable.js') }}
{{ HTML::script('assets/global/scripts/datatable.vi.js') }}
{{ HTML::script('assets/admin/pages/scripts/permission.js') }}
@stop

@section('jquery-document-ready')
Permission.init();
@stop

@section('page-content')
<input type="hidden" class="error-no-action" value="{{ trans('user-pages.list.message.error-no-action') }}"/>
<input type="hidden" class="error-no-item" value="{{ trans('user-pages.list.message.error-no-item') }}"/>
<div id="ajax-modal" class="modal fade container modal-scroll" tabindex="-1"></div>
<div class="portlet-body">
    <div class="tabbable-custom">
        <ul class="nav nav-tabs nav-tabs-lg">
            <li>
                <a href="#tab_1" data-toggle="tab">
                    {{{ trans('permission.set-permission') }}}
                </a>
            </li>
            <li>
                <a href="#tab_2" data-toggle="tab">
                    {{{ trans('permission.set-role') }}}
                </a>
            </li>
            <li>
                <a href="#tab_3" data-toggle="tab">
                    {{{ trans('permission.manage') }}}
                </a>
            </li>
        </ul>
        <div class="tab-content">
            <div class="tab-pane" id="tab_1">
                <div class="row">
                    <div class="col-md-12 col-sm-12">
                        <!-- BEGIN Portlet PORTLET-->
                        <div class="portlet box green">
                            <div class="portlet-title">
                                <div class="caption">
                                    {{ trans('permission.set-permission') }}
                                </div>
                                <div class="tools">
                                    <a href="#" data-load="false" data-url="{{ route('permission-load', ['page'=>'permission-role']) }}" class="reload page-reload"></a>
                                </div>
                            </div>
                            <div class="portlet-body"></div>
                        </div>
                        <!-- END Portlet PORTLET-->
                    </div>
                </div>
            </div>
            <div class="tab-pane" id="tab_2">
                <div class="row">
                    <div class="col-md-12 col-sm-12">
                        <div class="table-container">
                            <?php $isHide = CNamHoa::getHideClass('permission-assign-list', ['parameterInput' => ['sGroupActionName' => 'delete'], 'addClass' => 'hide']); ?>
                            <div class="table-actions-wrapper">
                                <span></span>
                                <select class="table-group-action-input form-control input-inline input-small input-sm">
                                    <option value="">{{ trans('system.select') }}...</option>
                                    <option class="{{$isHide}}" value="delete">{{ trans('system.button.delete') }}</option>
                                </select>
                                <button class="btn btn-sm blue table-group-action-submit"><i class="fa fa-check"></i> {{ trans('system.button.submit') }}</button>
                            </div>
                            <table class="table table-striped table-bordered table-hover" id="datatable_list" action="{{ route('permission-assign-list') }}">
                                <thead>
                                    <tr role="row" class="heading">
                                        <th width="1%">
                                            <input type="checkbox" class="group-checkable">
                                        </th>
                                        <th width="10%">
                                            {{ trans('user.userid') }}
                                        </th>
                                        <th width="25%">
                                            {{ trans('user.username') }}
                                        </th>
                                        <th width="25%">
                                            {{ trans('permission.role.name') }}
                                        </th>
                                        <th width="10%">
                                            {{ trans('system.actions') }}
                                        </th>
                                    </tr>
                                    <tr role="row" class="filter">
                                        <td></td>
                                        <td>
                                            <div class="margin-bottom-5">
                                                <input type="text" class="form-control form-filter input-sm" name="filter_user_id" placeholder="{{ trans('user.userid') }}">
                                            </div>
                                        </td>
                                        <td>
                                            <div class="margin-bottom-5">
                                                <input type="text" class="form-control form-filter input-sm" name="filter_username" placeholder="{{ trans('user.username') }}">
                                            </div>
                                        </td>
                                        <td>
                                            <select class="form-control form-filter input-sm" name="filter_rolename">
                                                <option value="">{{ trans('permission.role.name') }}</option>
                                                @foreach($Roles as $role)
                                                <option value="{{$role->id}}">{{ $role->name }}</option>
                                                @endforeach
                                            </select>
                                        </td>
                                        <td>
                                            <button class="btn btn-sm yellow filter-submit hide"><i class="fa fa-search"></i> {{ trans('system.search') }}</button>
                                            <button class="btn btn-sm default filter-cancel"><i class="fa fa-refresh"></i> {{ trans('system.button.reset') }}</button>
                                        </td>
                                    </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            <div class="tab-pane" id="tab_3">
                <div class="row">
                    <div class="col-md-6 col-sm-12">
                        <!-- BEGIN Portlet PORTLET-->
                        <div class="portlet box green">
                            <div class="portlet-title">
                                <div class="caption">
                                    {{ trans('permission.role.name') }}
                                </div>
                                <div class="tools">
                                    <a href="#" data-load="false" data-url="{{ route('permission-load', ['page'=>'role']) }}" class="reload page-reload"></a>
                                </div>
                                <div class="actions">
                                    <a href="#" data-url="{{ route('permission-create', ['page'=>'role']) }}" class="btn default btn-sm add-btn {{ CNamHoa::getHideClass('permission-create', ['addClass' => 'hide']) }}">
                                        <i class="fa fa-plus"></i> {{ trans('system.button.new') }}
                                    </a>
                                </div>
                            </div>
                            <div class="portlet-body"></div>
                        </div>
                        <!-- END Portlet PORTLET-->
                    </div>
                    <div class="col-md-6 col-sm-12 {{Auth::user()->id != 'admin' ? 'hide' : null }}">
                        <!-- BEGIN Portlet PORTLET-->
                        <div class="portlet box blue">
                            <div class="portlet-title">
                                <div class="caption">
                                    {{ trans('permission.permission.name') }}
                                </div>
                                <div class="tools">
                                    <a href="#" data-load="false" data-url="{{ route('permission-load', ['page'=>'permission']) }}" class="reload page-reload"></a>
                                </div>
                                <div class="actions">
                                    <a href="#" data-url="{{ route('permission-create', ['page'=>'permission']) }}" class="btn default btn-sm add-btn {{ CNamHoa::getHideClass('permission-create', ['addClass' => 'hide']) }}">
                                        <i class="fa fa-plus"></i> {{ trans('system.button.new') }}
                                    </a>
                                </div>
                            </div>
                            <div class="portlet-body"></div>
                        </div>
                        <!-- END Portlet PORTLET-->
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@stop